<h1>编辑作品</h1>

<% form_for(@work, :html => {:multipart => true}) do |f| %>
    <%= f.error_messages :header_message => nil, :message => nil%>
	<%= simple_text_field_for f, :title, { :text=>"标题" }%>
	<div class="required">
		<div class="form_text">
			<label for="work[retype]" class="label">选择分类</label>
			<span class="required_mark">*</span>
		</div>
		<%= f.select(:retype_id, Retype.find(:all).collect {|t| [ t.name, t.id ] }, :selected => @work.retype_id ) %>
	</div>
    <%= simple_text_area_for f, :desc, { :text=>"描述", :cols =>30, :rows => 5 } %>
   <% f.fields_for :pictures do |p| %>
   	<%= render :partial => "picture", :locals => { :f => p} %>
   <% end %>
   <%= add_picture(f)%>
    <%= f.submit '修改' %>
<% end %>
<div class="op">
	<%= link_to '查看', @work %> |
	<%= link_to '返回', works_path %>
</div>